package com.cn.learn.redis;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.concurrent.TimeUnit;

/**
 * @ClassName RedisApplication
 * @Description
 * @Author JiJiang
 * @Date 2023/6/25 23:19
 * @Version 1.0
 */
@SpringBootApplication
public class RedisApplication {

    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(RedisApplication.class, args);


//        RedisTemplate<String, Object> redisTemplate = (RedisTemplate<String, Object>) applicationContext.getBean("redisTemplate");
//
//
//        redisTemplate.opsForValue().set("TEST", "TTL");
//        redisTemplate.expire("TEST", 5, TimeUnit.SECONDS);


    }

}
